<template>
  <view class="anchor">
    <web-view v-if="isOption(url)" :src="url"></web-view>
    <view class="tip column">
      <text>如需浏览，请长按网址复制后使用浏览器打开</text>
      <text selectable>{{url}}</text>
    </view>
  </view>
</template>

<script setup lang="ts">
  import { onLoad } from '@dcloudio/uni-app';
  import {ref} from 'vue'
  
  const url = ref('')
  
  onLoad(e => {
    url.value = e.url
  })
  
  const isOption = ()=>{
    if(url.value){
      return url.value.indexOf('https://blog.csdn.net') !== -1
    }
  }
</script>

<style lang="scss" scoped>
  .tip{
    position: relative;
    top: 200rpx;
    width: 500rpx;
    margin: 0 auto;
    word-wrap: break-word;
    font-size: 30rpx;
    text-align: center;
    text:first-child{
      font-size: 40rpx;
      font-weight: bold;
      margin-bottom: 30rpx;
    }
  }
</style>